package com.iqiyi.pps.epg.core.model.program;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by karkarrotxu on 2016/3/9.
 */
public class CategoryData {
    private long id;
    private long pid;
    private String name;
    private int level;
    // default 0 ,  tag 1;
    private int dataMode = 0;
    private List<CategoryData> children = null;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void addChild(CategoryData node) {
        if (children == null) {
            children = new ArrayList<CategoryData>();
        }
        if (!children.contains(node)) {
            children.add(node);
        }
    }

    public boolean hasChildren(){
        return children != null;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getPid() {
        return pid;
    }

    public void setPid(long pid) {
        this.pid = pid;
    }

    public int getDataMode() {
        return dataMode;
    }

    public void setDataMode(int dataMode) {
        this.dataMode = dataMode;
    }
}
